package com.example.dialog.Adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.example.dialog.Fragment.DiscoverFragment;
import com.example.dialog.Fragment.FollowFragment;

public class HomeViewPagerAdapter extends FragmentStateAdapter {
    public HomeViewPagerAdapter(FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @Override
    public Fragment createFragment(int position) {
        return position == 0 ? new FollowFragment() : new DiscoverFragment();
    }

    @Override
    public int getItemCount() {
        return 2;
    }
}